import request from '@/utils/request'

/**
 * 获取员工列表
 */
export const getEmployeesList = params => request({
  url: '/users',
  params
})

/**
 * 获取用户数量
 */

export const getUsersCount = () => request({
  url: '/users/count'
})

/**
 * 添加员工，新建用户
 */

export const addEmployee = data => request({
  url: '/auth/local/register',
  method: 'post',
  data
})

/**
 * 获取指定用户
 */

export const getUserDetail = id => request({
  url: '/users/' + id
})

/**
 * 删除用户
 */
export const delEmployee = id => request({
  url: '/users/' + id,
  method: 'delete'
})

/**
 * 编辑用户
 */
export const editEmployee = data => request({
  url: '/users/' + data.id,
  method: 'put',
  data
})
